import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_mvvm/provider/provider_setup.dart';
import 'package:flutter_mvvm/ui/test_page.dart';
import 'package:flutter_mvvm/widget/NoSplashFactory.dart';
import 'package:provider/provider.dart';

import 'app/constants.dart';

void main() {
  runApp(App());
  //statusBar设置为透明，去除半透明遮罩
  SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);
  //初始化loading配置
  EasyLoading.instance.userInteractions = false;
}

class App extends StatelessWidget {
  const App({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MultiProvider(
        providers: providers,
        child: MaterialApp(
          home: TestPage(),
          theme: ThemeData(
            primaryColor: Constants.primaryColor,
            primaryColorLight: Constants.primaryColorLight,
            backgroundColor: Constants.colorDefaultPageBackground,
            accentColor: Constants.accentColor,
            splashFactory: NoSplashFactory(),
          ),
          builder: EasyLoading.init(),
        ));
  }
}
